package com.freewater.cargotracker.infrastructure.persistence.mybatis.mapper;

import com.freewater.cargotracker.infrastructure.persistence.mybatis.dbobject.VoyagePO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

@Mapper
public interface VoyageMapper {

    int insert(VoyagePO voyagePO);

    int updateByIdSelective(@Param("voyagePO") VoyagePO voyagePO,
                            @Param("changedFields") Set<String> changedFields);

    VoyagePO findById(Long id);

    VoyagePO findByVoyageNumber(String voyageNumber);

    List<VoyagePO> findAll();

    double findBookedCargoSize(Long voyageId);

    int deleteAll();
}
